var e = require("../../../@babel/runtime/helpers/defineProperty");

Component({
    properties: {
        datas: {
            type: null
        },
        component_id: {
            type: null
        },
        member_order: {
            type: null
        }
    },
    data: {
        emptyImage: "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/image.png",
        active: "",
        U_memberorder: [ {
            label: "waitPay",
            value: 0
        }, {
            label: "waitSend",
            value: 0
        }, {
            label: "waitReceive",
            value: 0
        }, {
            label: "waitrRefund",
            value: 0
        } ],
        U_memberorderhotel: [ {
            label: "waitPay",
            value: 0
        }, {
            label: "waitSure",
            value: 0
        }, {
            label: "waitEnter",
            value: 0
        }, {
            label: "waitCheckOut",
            value: 0
        } ],
        U_memberorderrelease: [ {
            label: "waitPay",
            value: 0
        }, {
            label: "waitSend",
            value: 0
        }, {
            label: "waitReceive",
            value: 0
        }, {
            label: "waitrRefund",
            value: 0
        } ],
        U_memberordergroup: [ {
            label: "",
            value: 0
        }, {
            label: "waitPay",
            value: 0
        }, {
            label: "waitSend",
            value: 0
        }, {
            label: "waitReceive",
            value: 0
        }, {
            label: "waitrRefund",
            value: 0
        } ],
        U_memberordergroup_ywm: [ {
            label: "",
            value: 0
        }, {
            label: "waitPay",
            value: 0
        }, {
            label: "waitSend",
            value: 0
        }, {
            label: "waitReceive",
            value: 0
        }, {
            label: "waitrRefund",
            value: 0
        } ],
        U_memberordergrab: [ {
            label: "waitPay",
            value: 0
        }, {
            label: "waitSend",
            value: 0
        }, {
            label: "waitReceive",
            value: 0
        }, {
            label: "waitrRefund",
            value: 0
        } ],
        U_memberorderlive_install: [ {
            status: 0,
            value: 0
        }, {
            status: 1,
            value: 0
        }, {
            status: 2,
            value: 0
        }, {
            status: 3,
            value: 0
        }, {
            status: 5,
            value: 0
        } ],
        U_memberorderlive_install_worker: [ {
            status: 0,
            value: 0
        }, {
            status: 1,
            value: 0
        }, {
            status: 2,
            value: 0
        }, {
            status: 3,
            value: 0
        }, {
            status: 5,
            value: 0
        } ],
        U_memberordercps: [ {
            status: -1,
            value: 0
        }, {
            status: 0,
            value: 0
        }, {
            status: 1,
            value: 0
        }, {
            status: 2,
            value: 0
        } ],
        U_memberordernew_group: [ {
            label: "waitPay",
            value: 0
        }, {
            label: "waitSend",
            value: 0
        }, {
            label: "waitReceive",
            value: 0
        }, {
            label: "waitrRefund",
            value: 0
        } ],
        U_yz_supply_cake: [ {
            label: "waitPay",
            value: 0
        }, {
            label: "waitSend",
            value: 0
        }, {
            label: "waitReceive",
            value: 0
        }, {
            label: "waitrRefund",
            value: 0
        } ],
        U_coupon_store_order: [ {
            value: 0
        }, {
            value: 0
        }, {
            value: 0
        }, {
            value: 0
        } ]
    },
    lifetimes: {
        attached: function() {
            var a, t = this;
            if (this.data.member_order && this.data.member_order.order) for (var r = 0; r < this.data.member_order.order.length; r++) {
                var s = this.data.member_order.order[r];
                0 == s.status ? this.setData(e({}, "U_memberorder[0].value", s.total)) : 1 == s.status ? this.setData(e({}, "U_memberorder[1].value", s.total)) : 2 == s.status ? this.setData(e({}, "U_memberorder[2].value", s.total)) : 11 == s.status && this.setData(e({}, "U_memberorder[3].value", s.total));
            }
            if (this.data.member_order && this.data.member_order.hotel_order && this.data.member_order.hotel_order.forEach(function(a) {
                0 == a.status ? t.setData(e({}, "U_memberorderhotel[0].value", a.total)) : 1 == a.status ? t.setData(e({}, "U_memberorderhotel[1].value", a.total)) : 2 == a.status ? t.setData(e({}, "U_memberorderhotel[2].value", a.total)) : 11 == a.status && t.setData(e({}, "U_memberorderhotel[3].value", a.total));
            }), this.data.member_order && this.data.member_order.lease_order && this.data.member_order.lease_order.forEach(function(a) {
                "0" == a.status ? t.setData(e({}, "U_memberorderrelease[0].value", a.total)) : "1" == a.status ? t.setData(e({}, "U_memberorderrelease[1].value", a.total)) : "2" == a.status ? t.setData(e({}, "U_memberorderrelease[2].value", a.total)) : "3" == a.status && t.setData(e({}, "U_memberorderrelease[3].value", a.total));
            }), this.data.member_order && this.data.member_order.fight_groups_order && this.data.member_order.fight_groups_order.forEach(function(a) {
                0 == a.status ? t.setData(e({}, "U_memberordergroup[1].value", a.total)) : 1 == a.status ? t.setData(e({}, "U_memberordergroup[2].value", a.total)) : 2 == a.status ? t.setData(e({}, "U_memberordergroup[3].value", a.total)) : 11 == a.status && t.setData(e({}, "U_memberordergroup[4].value", a.total));
            }), this.data.member_order && this.data.member_order.ywm_fight_groups_order && this.data.member_order.ywm_fight_groups_order.forEach(function(a) {
                1 == a.status ? t.setData(e({}, "U_memberordergroup_ywm[1].value", a.total)) : 3 == a.status ? t.setData(e({}, "U_memberordergroup_ywm[2].value", a.total)) : 4 == a.status ? t.setData(e({}, "U_memberordergroup_ywm[3].value", a.total)) : 11 == a.status && t.setData(e({}, "U_memberordergroup_ywm[4].value", a.total));
            }), this.data.member_order && this.data.member_order.snatch_regiment_order && this.data.member_order.snatch_regiment_order.forEach(function(a) {
                0 == a.status ? t.setData(e({}, "U_memberordergrab[0].value", a.total)) : 1 == a.status ? t.setData(e({}, "U_memberordergrab[1].value", a.total)) : 2 == a.status ? t.setData(e({}, "U_memberordergrab[2].value", a.total)) : 11 == a.status && t.setData(e({}, "U_memberordergrab[3].value", a.total));
            }), this.data.member_order && this.data.member_order.live_install_order && this.data.member_order.live_install_order.forEach(function(a) {
                0 == a.status ? t.setData(e({}, "U_memberorderlive_install[0].value", a.total)) : 1 == a.status ? t.setData(e({}, "U_memberorderlive_install[1].value", a.total)) : 2 == a.status ? t.setData(e({}, "U_memberorderlive_install[2].value", a.total)) : 3 == a.status && t.setData(e({}, "U_memberorderlive_install[4].value", a.total));
            }), this.data.member_order && this.data.member_order.live_install_work_order ? this.data.member_order.live_install_work_order.forEach(function(a) {
                2 == a.status ? t.setData(e({}, "U_memberorderlive_install_worker[0].value", a.total)) : 3 == a.status ? t.setData(e({}, "U_memberorderlive_install_worker[1].value", a.total)) : 4 == a.status ? t.setData(e({}, "U_memberorderlive_install_worker[2].value", a.total)) : 6 == a.status && t.setData(e({}, "U_memberorderlive_install_worker[4].value", a.total));
            }) : (this.data.datas.list = this.data.datas.list.filter(function(e) {
                return "U_memberorderlive_install_worker" != e.uikey;
            }), this.setData({
                "datas.list": this.data.datas.list
            })), this.data.member_order && this.data.member_order.aggregation_cps_order && this.data.member_order.aggregation_cps_order.forEach(function(a) {
                1 == a.status ? t.setData(e({}, "U_memberordercps[2].value", a.total)) : 2 == a.status ? t.setData(e({}, "U_memberordercps[3].value", a.total)) : -1 == a.status && t.setData(e({}, "U_memberordercps[0].value", a.total));
            }), this.data.member_order && this.data.member_order.group_work_order) for (var l = 0; l < this.data.member_order.group_work_order.length; l++) {
                var o = this.data.member_order.group_work_order[l];
                0 == o.status ? this.setData(e({}, "U_memberordernew_group[0].value", o.total)) : 1 == o.status ? this.setData(e({}, "U_memberordernew_group[1].value", o.total)) : 2 == o.status ? this.setData(e({}, "U_memberordernew_group[2].value", o.total)) : 11 == o.status && this.setData(e({}, "U_memberordernew_group[3].value", o.total));
            }
            if (this.data.member_order && null !== (a = this.data.member_order) && void 0 !== a && a.yz_supply_cake_order) for (var u = 0; u < this.data.member_order.yz_supply_cake_order.length; u++) {
                var m = this.data.member_order.yz_supply_cake_order[u];
                0 == m.status ? this.setData(e({}, "U_yz_supply_cake[0].value", m.total)) : 1 == m.status ? this.setData(e({}, "U_yz_supply_cake[1].value", m.total)) : 2 == m.status ? this.setData(e({}, "U_yz_supply_cake[2].value", m.total)) : 3 == m.status && this.setData(e({}, "U_yz_supply_cake[3].value", m.total));
            }
            if (this.data.member_order && this.data.member_order.coupon_store_order) {
                var i = 0, d = this.data.datas.list[i].datas.list.value;
                this.data.datas.list.map(function(e, a) {
                    "U_coupon_store_order" == e.uikey && (i = a);
                }), d.map(function(e) {
                    var a;
                    e.total = (null === (a = t.data.member_order.coupon_store_order.find(function(a) {
                        return a.status == e.id;
                    })) || void 0 === a ? void 0 : a.total) || 0;
                }), this.setData(e({}, "datas.list[" + i + "].datas.list.value", d));
            }
        },
        moved: function() {},
        detached: function() {}
    },
    attached: function() {},
    ready: function() {},
    pageLifetimes: {
        show: function() {},
        hide: function() {},
        resize: function() {}
    },
    methods: {
        bindTags: function(e) {
            var a = e.detail.index;
            if (this.setData({
                active: a
            }), "U_memberorder_ys" == this.data.datas.list[a].uikey) return wx.navigateTo({
                url: "/packageA/member/myOrder_v2/myOrder_v2?status=0&orderType=ysSystem"
            }), !1;
        },
        goAllOrderlist: function(e) {
            var a = "";
            switch (this.data.datas.list[0].uikey) {
              case "U_memberorder":
                a = "";
                break;

              case "U_memberorderhotel":
                a = "hotel";
                break;

              case "U_memberorderrelease":
                a = "lease_toy";
                break;

              case "U_memberordergroup":
                a = "groups";
                break;

              case "U_memberordergroup_ywm":
                a = "ywmgroups";
                break;

              case "U_memberordergrab":
                a = "grabGroup";
                break;

              case "U_memberordernew_group":
                a = "groupWork";
                break;

              case "U_memberorder_ys":
                a = "ysSystem";
                break;

              case "U_yz_supply_cake":
                a = "sachertorte";
            }
            var t = e.currentTarget.dataset.name;
            wx.navigateTo({
                url: "/packageA/member/myOrder_v2/myOrder_v2?status=0&orderType=" + a + "&title=" + t
            });
        },
        goorderlist: function(e) {
            var a = e.currentTarget.dataset, t = a.status, r = a.name;
            4 != t ? wx.navigateTo({
                url: "/packageA/member/myOrder_v2/myOrder_v2?status=" + t + "&title=" + r
            }) : wx.navigateTo({
                url: "/packageD/member/myOrder/Aftersaleslist/Aftersaleslist"
            });
        },
        gohotelOrderlist: function(e) {
            var a = e.currentTarget.dataset, t = a.status, r = a.name;
            wx.navigateTo({
                url: "/packageA/member/myOrder_v2/myOrder_v2?status=" + t + "&orderType=hotel&title=" + r
            });
        },
        goleaseOrderlist: function(e) {
            var a = e.currentTarget.dataset, t = a.status, r = a.name;
            wx.navigateTo({
                url: "/packageA/member/myOrder_v2/myOrder_v2?status=" + t + "&orderType=lease_toy&title=" + r
            });
        },
        gogroupOrderlist: function(e) {
            var a = e.currentTarget.dataset, t = a.status, r = a.name;
            5 != t ? wx.navigateTo({
                url: "/packageA/member/myOrder_v2/myOrder_v2?status=" + t + "&orderType=groups&title=" + r
            }) : wx.navigateTo({
                url: "/packageD/member/myOrder/Aftersaleslist/Aftersaleslist?orderType=groups"
            });
        },
        goywmgroupOrderlist: function(e) {
            var a = e.currentTarget.dataset, t = a.status, r = a.name;
            5 != t ? 2 != t ? wx.navigateTo({
                url: "/packageA/member/myOrder_v2/myOrder_v2?status=" + t + "&orderType=ywmgroups&title=" + r
            }) : wx.navigateTo({
                url: "/packageA/member/myOrder_v2/myOrder_v2?status=1&orderType=ywmgroups"
            }) : wx.navigateTo({
                url: "/packageD/member/myOrder/Aftersaleslist/Aftersaleslist?orderType=ywmgroups"
            });
        },
        gograbOrderlist: function(e) {
            var a = e.currentTarget.dataset, t = a.status, r = a.name;
            wx.navigateTo({
                url: "/packageA/member/myOrder_v2/myOrder_v2?status=" + t + "&orderType=grabGroup&title=" + r
            });
        },
        cakeOrderList: function(e) {
            var a = e.currentTarget.dataset, t = a.status, r = a.name, s = a.type;
            wx.navigateTo({
                url: "/packageA/member/myOrder_v2/myOrder_v2?status=".concat(t, "&orderType=").concat(s, "&title=").concat(r)
            });
        },
        tiktokCpsOrder: function(e) {
            var a = e.currentTarget.dataset.status;
            wx.navigateTo({
                url: "/packageF/cps/order/order?status=".concat(a)
            });
        },
        golive_installOrderlist: function(e) {
            var a = e.currentTarget.dataset, t = a.status, r = a.name;
            wx.navigateTo({
                url: "/packageH/installationSever/installationSeverMemberHome/installationSeverMemberHome?status=" + t + "&title=" + r
            });
        },
        golive_install_workOrderlist: function(e) {
            var a = e.currentTarget.dataset, t = a.status, r = a.name;
            -1 != t ? wx.navigateTo({
                url: "/packageH/installationSever/installationSeverHome/installationSeverHome?status=" + t + "&title=" + r
            }) : wx.navigateTo({
                url: "/packageH/installationSever/installationSeverHome/installationSeverHome?status=1"
            });
        },
        gocpsOrderlist: function(e) {
            var a = e.currentTarget.dataset, t = a.status, r = a.name;
            3 != t ? wx.navigateTo({
                url: "/packageA/member/order/cpsOrder/cpsOrder?status=" + t + "&title=" + r
            }) : wx.navigateTo({
                url: "/packageA/member/order/cpsCoupon/cpsCoupon&title=" + r
            });
        },
        goGroupWorkorderlist: function(e) {
            var a = e.currentTarget.dataset, t = a.status, r = a.name;
            4 != t ? wx.navigateTo({
                url: "/packageA/member/myOrder_v2/myOrder_v2?status=" + t + "&orderType=groupWork&title=" + r
            }) : wx.navigateTo({
                url: "/packageD/member/myOrder/Aftersaleslist/Aftersaleslist"
            });
        },
        goCouponStorederlist: function(e) {
            var a = e.currentTarget.dataset, t = a.status, r = a.name;
            -1 != t ? wx.navigateTo({
                url: "/packageF/consumption/orderList/orderList?status=" + t + "&title=" + r
            }) : wx.navigateTo({
                url: "/packageD/member/myOrder/Aftersaleslist/Aftersaleslist"
            });
        }
    },
    observers: {
        "member_order.**": function(a) {
            if (a) for (var t = 0; t < a.order.length; t++) {
                var r = a.order[t];
                0 == r.status ? this.setData(e({}, "U_memberorder[0].value", r.total)) : 1 == r.status ? this.setData(e({}, "U_memberorder[1].value", r.total)) : 2 == r.status ? this.setData(e({}, "U_memberorder[2].value", r.total)) : 11 == r.status && this.setData(e({}, "U_memberorder[3].value", r.total));
            }
        }
    }
});